//-------------------------------------------------------------------
//	Copyright (c) 2012-2014 Zhirnov Andrey
//	This file is part of the "UXGEN-ES" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#pragma once

#include "Graphics/MetaData/Meta.RenderState.h"

#ifdef ENGINE_META_DATA
#	include "Graphics/GLshell/Sampler.h"
#endif


	//
	// Sampler
	//
#ifdef ENGINE_META_DATA
	namespace MetaData
	{
	
		template <>
		inline void MetaDataUtils::Copy<> (Sampler::Wrap &left, ivec3 &right, const EngineSubSystemsRef ess)
		{
			left = Sampler::Wrap( (gl_wrap::type)right[0], (gl_wrap::type)right[1], (gl_wrap::type)right[2] );
		}
	
		template <>
		inline void MetaDataUtils::Copy<> (Sampler::Filter &left, ivec2 &right, const EngineSubSystemsRef ess)
		{
			left = Sampler::Filter( (gl_filter::type)right[0], (gl_filter::type)right[1] );
		}
	}
#endif

#	define META_OBJECT			SamplerCfg
#	define META_OBJECT_NAME		TOSTRING( Sampler )
#	define META_NAME			MetaSampler
#	define META_BASECLASS		Sampler

#	define META_FIELDS( _decl ) \
		_decl( ivec3,		wrap,			wrap,			ivec3(/*CLAMP*/0x812F) ) \
		_decl( ivec2,		filter,			filter,			ivec2(/*LINEAR*/0x2601) ) \
		_decl( int,			compareRTT,		compareRTT,		0 ) \
		_decl( uint8,		anisotropy,		anisotropy,		0 )
			
#	include "Base/MetaData/MetaDataObject.h"
